<html>
<!-- =====================================================================

  File:      Generated file for Adventure Works Cycles Storefront Sample
  Summary:   Self-documentation for application
  Date:	     June 16, 2003

=====================================================================

  This file is part of the Microsoft SQL Server Code Samples.
  Copyright (C) 2003 Microsoft Corporation.  All rights reserved.

This source code is intended only as a supplement to Microsoft
Development Tools and/or on-line documentation.  See these other
materials for detailed information regarding Microsoft code samples.

THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

======================================================= -->
<head>
  <link rel=stylesheet href=style.css>
</head>
<body>
<div class=SourcePanel style="font-size:12">
<pre style="background-color:white">
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Collections</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">ComponentModel</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Data</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Drawing</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span>.<span style="color: #2040a0">SessionState</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span>.<span style="color: #2040a0">UI</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span>.<span style="color: #2040a0">UI</span>.<span style="color: #2040a0">WebControls</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span>.<span style="color: #2040a0">UI</span>.<span style="color: #2040a0">HtmlControls</span><span style="color: #4444FF">;</span>
<span style="color: #0000FF"><strong>using</strong></span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Globalization</span><span style="color: #4444FF">;</span>

<span style="color: #008000">/* =====================================================================

  File:      ProductDetails.aspx.cs for Adventure Works Cycles Storefront Sample
  Summary:   Displays information about a particular product, including upsell information via 
			 the _AlsoBought.ascx user control
  Date:	     June 16, 2003

---------------------------------------------------------------------

  This file is part of the Microsoft SQL Server Code Samples.
  Copyright (C) Microsoft Corporation.  All rights reserved.

This source code is intended only as a supplement to Microsoft
Development Tools and/or on-line documentation.  See these other
materials for detailed information regarding Microsoft code samples.

THIS CODE AND INFORMATION ARE PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

======================================================= */</span>

<span style="color: #0000FF"><strong>namespace</strong></span> <span style="color: #2040a0">Microsoft</span>.<span style="color: #2040a0">Samples</span>.<span style="color: #2040a0">SqlServer</span> 
<span style="color: #4444FF"><strong>{</strong></span>

    <span style="color: #0000FF"><strong>public</strong></span> <span style="color: #2040a0">partial</span> <span style="color: #0000FF"><strong>class</strong></span> <span style="color: #2040a0">ProductDetailsPage</span> <span style="color: #4444FF">:</span> <span style="color: #2040a0">System</span>.<span style="color: #2040a0">Web</span>.<span style="color: #2040a0">UI</span>.<span style="color: #2040a0">Page</span>
    <span style="color: #4444FF"><strong>{</strong></span>

    
<span style="color: #008000">//         public ProductDetailsPage() {</span>
<span style="color: #008000">//             Page.Init += new System.EventHandler(Page_Init);</span>
<span style="color: #008000">//         }</span>

        <span style="color: #008000">//*******************************************************</span>
        <span style="color: #008000">//</span>
        <span style="color: #008000">// The Page_Load event on this page is used to obtain</span>
        <span style="color: #008000">// product information from a database and then update</span>
        <span style="color: #008000">// UI elements with them.</span>
        <span style="color: #008000">//</span>
        <span style="color: #008000">// Note that this page is output cached at 1 minute</span>
        <span style="color: #008000">// intervals.  This eliminates the need to hit the database</span>
        <span style="color: #008000">// on each request to the page.</span>
        <span style="color: #008000">//</span>
        <span style="color: #008000">//*******************************************************</span>

        <span style="color: #0000FF"><strong>private</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">Page_Load</span><span style="color: #4444FF">(</span><span style="color: #2040a0">object</span> <span style="color: #2040a0">sender</span>, <span style="color: #2040a0">System</span>.<span style="color: #2040a0">EventArgs</span> <span style="color: #2040a0">e</span><span style="color: #4444FF">)</span> <span style="color: #4444FF"><strong>{</strong></span>

            <span style="color: #008000">// Obtain ProductID from QueryString</span>
            <span style="color: #0000FF"><strong>int</strong></span> <span style="color: #2040a0">ProductID</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">Int32</span>.<span style="color: #2040a0">Parse</span><span style="color: #4444FF">(</span><span style="color: #2040a0">Request</span>.<span style="color: #2040a0">Params</span><span style="color: #4444FF">[</span><span style="color: #444444">&quot;ProductID&quot;</span><span style="color: #4444FF">]</span>, <span style="color: #2040a0">CultureInfo</span>.<span style="color: #2040a0">InvariantCulture</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

            <span style="color: #008000">// Obtain Product Details</span>
            <span style="color: #2040a0">ProductsDB</span> <span style="color: #2040a0">products</span> <span style="color: #4444FF">=</span> <span style="color: #0000FF"><strong>new</strong></span> <span style="color: #2040a0">ProductsDB</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
            <span style="color: #2040a0">ProductDetails</span> <span style="color: #2040a0">myProductDetails</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">products</span>.<span style="color: #2040a0">GetProductDetails</span><span style="color: #4444FF">(</span><span style="color: #2040a0">ProductID</span>, <span style="color: #2040a0">WorldReady</span>.<span style="color: #2040a0">CurrentLanguage</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>

            <span style="color: #008000">// Update Controls with Product Details</span>
            <span style="color: #2040a0">description</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">myProductDetails</span>.<span style="color: #2040a0">Description</span><span style="color: #4444FF">;</span>
            <span style="color: #2040a0">UnitCost</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">myProductDetails</span>.<span style="color: #2040a0">UnitCost</span><span style="color: #4444FF">;</span>
            <span style="color: #2040a0">ModelName</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">myProductDetails</span>.<span style="color: #2040a0">ModelName</span><span style="color: #4444FF">;</span>
            <span style="color: #2040a0">ModelNumber</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">myProductDetails</span>.<span style="color: #2040a0">ModelNumber</span>.<span style="color: #2040a0">ToString</span><span style="color: #4444FF">(</span><span style="color: #2040a0">CultureInfo</span>.<span style="color: #2040a0">InvariantCulture</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
			<span style="color: #2040a0">ProductNumber</span>.<span style="color: #2040a0">Text</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">ProductID</span>.<span style="color: #2040a0">ToString</span><span style="color: #4444FF">(</span><span style="color: #2040a0">CultureInfo</span>.<span style="color: #2040a0">InvariantCulture</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
            <span style="color: #2040a0">ProductImage</span>.<span style="color: #2040a0">ImageUrl</span> <span style="color: #4444FF">=</span> <span style="color: #444444">&quot;ProductImages/&quot;</span> <span style="color: #4444FF">+</span> <span style="color: #2040a0">myProductDetails</span>.<span style="color: #2040a0">ProductImage</span><span style="color: #4444FF">;</span>
            <span style="color: #2040a0">addToCart</span>.<span style="color: #2040a0">NavigateUrl</span> <span style="color: #4444FF">=</span> <span style="color: #444444">&quot;AddToCart.aspx?ProductID=&quot;</span> <span style="color: #4444FF">+</span> <span style="color: #2040a0">ProductID</span><span style="color: #4444FF">;</span>
            <span style="color: #2040a0">ReviewList</span>.<span style="color: #2040a0">ProductID</span> <span style="color: #4444FF">=</span> <span style="color: #2040a0">ProductID</span><span style="color: #4444FF">;</span>
        <span style="color: #4444FF"><strong>}</strong></span>

        <span style="color: #0000FF"><strong>private</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">Page_Init</span><span style="color: #4444FF">(</span><span style="color: #2040a0">object</span> <span style="color: #2040a0">sender</span>, <span style="color: #2040a0">EventArgs</span> <span style="color: #2040a0">e</span><span style="color: #4444FF">)</span> <span style="color: #4444FF"><strong>{</strong></span>
            <span style="color: #008000">//</span>
            <span style="color: #008000">// CODEGEN: This call is required by the ASP.NET Web Form Designer.</span>
            <span style="color: #008000">//</span>
            <span style="color: #2040a0">InitializeComponent</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span><span style="color: #4444FF">;</span>
        <span style="color: #4444FF"><strong>}</strong></span>

<span style="color: #0000ff"><strong>		#region Web Form Designer generated code</strong></span>
        <span style="color: #008000">/// &lt;summary&gt;</span>
        <span style="color: #008000">/// Required method for Designer support - do not modify</span>
        <span style="color: #008000">/// the contents of this method with the code editor.</span>
        <span style="color: #008000">/// &lt;/summary&gt;</span>
        <span style="color: #0000FF"><strong>private</strong></span> <span style="color: #0000FF"><strong>void</strong></span> <span style="color: #2040a0">InitializeComponent</span><span style="color: #4444FF">(</span><span style="color: #4444FF">)</span> <span style="color: #4444FF"><strong>{</strong></span>
        <span style="color: #4444FF"><strong>}</strong></span>
<span style="color: #0000ff"><strong>		#endregion</strong></span>

    <span style="color: #4444FF"><strong>}</strong></span>
<span style="color: #4444FF"><strong>}</strong></span>

</pre>
